home *** CD-ROM | disk | FTP | other *** search
- /*
- * The original copyright owners of the accompanying source code files have
- * agreed to place such code into the public domain. Accordingly, anyone
- * who receives or obtains a copy of such source code is freely entitled to
- * reproduce, use and otherwise exploit such code (including the right to
- * make derivative works), at his/her own risk and expense, without any
- * obligation or liability to the original copyright owners.
- *
- * We would appreciate (but do not require) that the following message be
- * included in any derivative works:
- *
- * "Portions of this program were developed by Peter Broadwell, Rob Myers
- * and Robin Schaufler while working in Silicon Valley."
- *
- * The accompanying source code files and related documentation materials
- * are distributed on an "AS IS" basis, without any warranties or
- * guarantees of any kind. All implied warranties, including the implied
- * warranties of merchantability and of fitness for any particular purpose,
- * are expressly disclaimed.
- */
- #include "gl.h"
- #include "geom.h"
- #include "selectors.h"
- #include "class.h"
- #include "classIds.h"
- #include "mbox.h"
- #include "individual.h"
- #include "behavior.h"
- #include "doers.h"
-
- #include "toad.h"
- #include "colors.h"
-
- extern class indivClass;
- model toadStone;
- model toadTop;
- extern char *toadinit();
-
- fcnTable toadTable[] = {
- INIT, toadinit,
- EOTABLE,
- };
-
- class toadClass = {
- &indivClass,
- toadTable,
- sizeof(toad),
- TOAD,
- };
-
- toad toadTemplate = {
- /* inst */
- &toadClass, /* myClass pointer */
- NULL, /* classFunctions */
- 0, /* nFunctions */
- /* mailbox */
- NULL, /* subscribers */
- NULL, /* subscribedTo */
- /* individual */
- {0,0,-500}, /* position */
- {0,0,0}, /* lastPosition */
- {1,0,0}, /* delta */
- {0,0,0}, /* velocity */
- {0,0,0}, /* avelocity */
- {0,0,0}, /* acceleration */
- 1.0, /* speed */
- {0,0,10}, /* heading */
- {0,700,700}, /* rotation */
- {0,0,0}, /* influence */
- 1.0, /* scale */
- &toadStone, /* model */
- NULL, /* flags */
- NULL, /* curVars */
- NULL, /* controls */
- /* toad */
- 40.0, /* size */
- };
-
- long toadStoneVertices[] = {
- 0,0,
- };
-
- model toadStone = {
- &toadTop, /* next model segment */
- 0, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- NULL, /* point dictionary */
- toadStoneVertices, /* polygon descriptions */
- { 0,0,0}, /* centroid */
- TOADSTONE_COLOR, /* color */
- TOADSTONE_TEXTURE, /* texture */
- FALSE, /* outlined */
- {400,700,700}, /* rotation */
- {0,0,0}, /* translate */
- {1.0,1.0,1.0}, /* scale */
- 0, /* declasse */
- };
-
- point toadBodyPoints[] = {
- { 0, 0, 0, }, /* gratuitous vertex 0 */
- { 000, 000, 990, },
- { -500, 000, 850, },
- { -500, -100, 850, },
- { 000, -400, 770, },
- { 990, -100, 750, }, /* pnt 5 */
- { 990, 000, 750, },
- { 990, 100, 750, },
- { 000, 400, 770, },
- { -500, 100, 850, },
- { -470, 190, 850, }, /* pnt 10 */
- { -200, 300, 450, },
- { 300, 260, 440, },
- { 900, 90, 650, },
- { 900, -90, 650, },
- { 300, -260, 440, },
- { -200, -300, 450, },
- { -470, -190, 850, },
- };
-
- /* null terminated polys, double null at end */
- long toadTopVertices[] = {
- 2,1,3,0, /* top */
- 3,1,4,0,
- 4,1,5,0,
- 5,1,6,0,
- 6,1,7,0,
- 7,1,8,0,
- 8,1,9,0,
- 9,1,2,0,
- 0,
- };
-
- point toadLFLegPoints[] = {
- { 0, 0, 0, }, /* gratuitous vertex 0 */
- { 0, 300, 400, },
- { -275, 200, 275, }, /* elbow Top*/
- { -400, 200, 280, },
- { -380, 200, 260, },
- { -405, 200, 240, },
- { -265, 200, 270, }, /* elbow bottom */
- { 40, 300, 390, },
- };
-
- point toadRFLegPoints[] = {
- { 0, 0, 0, }, /* gratuitous vertex 0 */
- { 0, -300, 400, },
- { -275, -200, 275, }, /* elbow Top*/
- { -400, -200, 280, },
- { -380, -200, 260, },
- { -405, -200, 240, },
- { -265, -200, 270, }, /* elbow bottom */
- { 40, -300, 390, },
- };
-
- point toadLBLegPoints[] = {
- { 0, 0, 0, }, /* gratuitous vertex 0 */
- { 700, 200, 275, },
- { 800, 200, 280, }, /* elbow Top*/
- { 720, 100, 260, },
- { 750, 100, 240, },
- { 730, 100, 270, },
- { 910, 100, 390, }, /* elbow bottom */
- { 815, 100, 580, },
- { 900, 90, 650, },
- };
-
- /* null terminated polys, double null at end */
- long toadTop1Vertices[] = {
- 1,2,6,0,
- 2,3,4,0,
- 2,4,6,0,
- 4,5,6,0,
- 6,7,1,0,
- 0,
- };
- long toadTop2Vertices[] = {
- 1,2,6,0,
- 2,3,4,0,
- 2,4,6,0,
- 4,5,6,0,
- 6,7,1,0,
- 9,1,7,0,
- 9,7,8,0,
- 0,
- };
- long toadTop3Vertices[] = {
- 0,
- };
- long toadTop4Vertices[] = {
- 0,
- };
- /* null terminated polys, double null at end */
- long toadBellyVertices[] = {
- 8,9,10,0, /* Left side */
- 8,10,11,0,
- 8,11,12,0,
- 8,12,13,0,
- 8,13,7,0,
- 7,13,14,0, /* tush */
- 6,7,14,0,
- 5,6,14,0,
- 14,4,5,0, /* right side */
- 15,4,14,0,
- 16,4,15,0,
- 17,4,16,0,
- 3,4,17,0,
- 2,3,17,0, /* snout */
- 10,2,17,0,
- 9,2,10,0,
- 10,17,16,0, /* belly */
- 10,16,11,0,
- 11,16,15,0,
- 11,15,12,0,
- 12,15,14,0,
- 12,14,13,0,
- 0,
- };
-
- model toadBody4 = {
- 0, /* next model segment */
- 0, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- toadBodyPoints, /* point dictionary */
- toadTop4Vertices, /* polygon descriptions */
- { 0,0,200}, /* centroid */
- EGG_COLOR, /* color */
- GUPPYBODY_TEXTURE, /* texture */
- /* TOADSTONE_COLOR, /* color */
- /* TOADSTONE_TEXTURE, /* texture */
- TRUE, /* outlined */
- { 0,0,0}, /* rotation */
- { 0,0,0}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 1, /* declasse */
- };
-
- model toadBody3 = {
- &toadBody4, /* next model segment */
- 0, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- toadBodyPoints, /* point dictionary */
- toadTop3Vertices, /* polygon descriptions */
- { 0,0,200}, /* centroid */
- GUPPYIRIS_COLOR, /* color */
- GUPPYBODY_TEXTURE, /* texture */
- /* TOADSTONE_COLOR, /* color */
- /* TOADSTONE_TEXTURE, /* texture */
- TRUE, /* outlined */
- { 0,0,0}, /* rotation */
- { 0,0,0}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 1, /* declasse */
- };
-
- model toadBody2 = {
- &toadBody3, /* next model segment */
- 0, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- toadBodyPoints, /* point dictionary */
- toadTop2Vertices, /* polygon descriptions */
- { 0,0,200}, /* centroid */
- GUPPYEYE_COLOR, /* color */
- GUPPYBODY_TEXTURE, /* texture */
- /* TOADSTONE_COLOR, /* color */
- /* TOADSTONE_TEXTURE, /* texture */
- TRUE, /* outlined */
- { 0,0,0}, /* rotation */
- { 0,0,0}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 1, /* declasse */
- };
-
- model toadBody1 = {
- &toadBody2, /* next model segment */
- 0, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- toadBodyPoints, /* point dictionary */
- toadTop1Vertices, /* polygon descriptions */
- { 0,0,200}, /* centroid */
- GUPPYBODY_COLOR, /* color */
- GUPPYBODY_TEXTURE, /* texture */
- /* TOADSTONE_COLOR, /* color */
- /* TOADSTONE_TEXTURE, /* texture */
- TRUE, /* outlined */
- { 0,0,0}, /* rotation */
- { 0,0,0}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 1, /* declasse */
- };
-
- model toadBelly = {
- &toadBody1, /* next model segment */
- 0, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- toadBodyPoints, /* point dictionary */
- toadBellyVertices, /* polygon descriptions */
- { 0,0,200}, /* centroid */
- MINNOWBODY_COLOR, /* color */
- GUPPYBODY_TEXTURE, /* texture */
- /* TOADSTONE_COLOR, /* color */
- /* TOADSTONE_TEXTURE, /* texture */
- 0, /* outlined */
- { 0,0,0}, /* rotation */
- { 0,0,0}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 1, /* declasse */
- };
-
- model toadTop = {
- &toadBelly, /* next model segment */
- 0, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- toadBodyPoints, /* point dictionary */
- toadTopVertices, /* polygon descriptions */
- { 0,0,200}, /* centroid */
- TOADTOP_COLOR, /* color */
- GUPPYBODY_TEXTURE, /* texture */
- /* TOADSTONE_COLOR, /* color */
- /* TOADSTONE_TEXTURE, /* texture */
- TRUE, /* outlined */
- { 0,0,0}, /* rotation */
- { 0,0,0}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 1, /* declasse */
- };
-